package org.example.DesignPatterns.Proxy.Internet;

/**
 * @description:直接与互联网链接的调制解调器（猫）
 * @author: farprt
 * @create: 2022-09-18 15:35
 **/
public class Modem implements Internet{

    public Modem(String password) throws Exception {
        if(!"123456".equals(password)){
            throw new Exception("拨号失败，请重试");
        }
        System.out.println("拨号上网...链接成功");
    }

    @Override
    public void httpAccess(String url) {
        System.out.println("正在访问"+url);
    }
}